Index: channels/iax2.h =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2.h,v retrieving revision 1.13 diff -u -r1.13 iax2.h --- channels/iax2.h 1 Oct 2003 22:59:06 -0000 1.13 +++ channels/iax2.h 19 Feb 2004 05:12:36 -0000 @@ -104,6 +104,7 @@ #define IAX_IE_PROVISIONING 29 /* Provisioning info */ #define IAX_IE_AESPROVISIONING 30 /* AES Provisioning info */ #define IAX_IE_DATETIME 31 /* Date/Time */ +#define IAX_IE_RESTRICTCID 32 /* restrict Caller*ID flag */ #define IAX_AUTH_PLAINTEXT (1 << 0) #define IAX_AUTH_MD5 (1 << 1) Index: channels/iax2-parser.h =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.h,v retrieving revision 1.6 diff -u -r1.6 iax2-parser.h --- channels/iax2-parser.h 1 Oct 2003 22:59:06 -0000 1.6 +++ channels/iax2-parser.h 19 Feb 2004 05:12:36 -0000 @@ -44,6 +44,7 @@ int musiconhold; unsigned int transferid; unsigned int datetime; + int restrictcid; }; #define DIRECTION_INGRESS 1 Index: channels/iax2-parser.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.c,v retrieving revision 1.14 diff -u -r1.14 iax2-parser.c --- channels/iax2-parser.c 22 Oct 2003 02:53:39 -0000 1.14 +++ channels/iax2-parser.c 19 Feb 2004 05:12:37 -0000 @@ -120,6 +120,7 @@ { IAX_IE_PROVISIONING, "PROVISIONING" }, { IAX_IE_AESPROVISIONING, "AES PROVISIONING" }, { IAX_IE_DATETIME, "DATE TIME", dump_int }, + { IAX_IE_RESTRICTCID, "RESTRICTCID" }, }; const char *iax_ie2str(int ie) @@ -506,6 +507,9 @@ errorf(tmp); } else ies->datetime = ntohl(*((unsigned int *)(data + 2))); + break; + case IAX_IE_RESTRICTCID: + ies->restrictcid = 1; break; default: snprintf(tmp, sizeof(tmp), "Ignoring unknown information element '%s' (%d) of length %d\n", iax_ie2str(ie), ie, len); Index: channels/chan_iax2.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v retrieving revision 1.88 diff -u -r1.88 chan_iax2.c --- channels/chan_iax2.c 12 Jan 2004 18:03:35 -0000 1.88 +++ channels/chan_iax2.c 19 Feb 2004 05:12:37 -0000 @@ -410,6 +410,8 @@ int trunkerror; struct iax2_dpcache *dpentries; int notransfer; /* do we want native bridging */ + + int restrictcid; }; static struct ast_iax2_queue { @@ -1841,8 +1843,15 @@ if (l) ast_shrink_phone_number(l); } - /* Now build request */ + /* Now build request */ memset(&ied, 0, sizeof(ied)); + /* 11th feb 04/flying_sushi + * check whether CallingPresentation flag is set + * and pass IAX_IE_RESTRICTCID to remote peer + */ + if (c->restrictcid || c->callingpres >= 0x20) { + iax_ie_append(&ied, IAX_IE_RESTRICTCID); + } /* On new call, first IE MUST be IAX version of caller */ iax_ie_append_short(&ied, IAX_IE_VERSION, IAX_PROTO_VERSION); iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, rdest); @@ -2246,6 +2255,8 @@ strncpy(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode)-1); if (i->amaflags) tmp->amaflags = i->amaflags; + /* 11th feb. 04 flying_sushi */ + tmp->restrictcid = i->restrictcid; strncpy(tmp->context, i->context, sizeof(tmp->context)-1); strncpy(tmp->exten, i->exten, sizeof(tmp->exten)-1); tmp->adsicpe = i->peeradsicpe; @@ -2883,6 +2894,11 @@ gotcapability = 1; iaxs[callno]->peercapability = ies->capability; } + if (ies->restrictcid) { + iaxs[callno]->restrictcid = 1; + } else { + iaxs[callno]->restrictcid = 0; + } if (ies->version) version = ies->version; if (!gotcapability)